import { IResponseBase } from '@/api/user/type'
import request from '../../../utils/request'
import type { ISkuInfoResponse, ISkuListResponse } from './type'

export const reqSkuList = (page: number, limit: number) =>
  request.get<any, ISkuListResponse>(`/admin/product/list/${page}/${limit}`)

export const reqCancelSku = (skuId: string) =>
  request.get(`/admin/product/cancelSale/${skuId}`)

export const reqOnSku = (skuId: string) =>
  request.get(`/admin/product/onSale/${skuId}`)

export const reqSkuInfo = (skuId: string) =>
  request.get<any, ISkuInfoResponse>(`/admin/product/getSkuInfo/${skuId}`)
export const reqDeleteSku = (skuId: string) =>
  request.delete<any, IResponseBase>('/admin/product/deleteSku/' + skuId)
